package com.test.controller;

import com.test.pojo.Street;
import com.test.service.StreetService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/streets")
@CrossOrigin(origins = "*")
public class StreetController {
    @Autowired
    private StreetService streetService;

    @GetMapping("/list")
    public List<Street> list() {
        return streetService.findAll();
    }
}